package com.fun.feifun.modules.business.constant;


public enum OrderStatusEnum {
    initFail("用户下单失败",-1),
    init("用户下单成功",1),
    MateSuccess("匹配成功",2),
    MateFail("匹配失败",3),
    //调用接口支付中。
    Payment("供货商下单中",4),
    PaymentSuccess ("供货商下单成功",5),
    PaymentFailed("供货商下单失败",6),
    PaySuccess("充值成功",7),
    PayFail("充值失败",8),
    WaitPull("待自供货取单",9),
    AlreadyPull("自供货已取单",10)
    ;

    private String title;
    private Integer value;


    OrderStatusEnum(String title, Integer value){
        this.title=title;
        this.value=value;
    }

    // 根据key获取value的方法
    public static String getTitleByValue(Integer value){
        for (OrderStatusEnum status : OrderStatusEnum.values()) {
            if (status.getValue().equals(value)) {
                return status.getTitle();
            }
        }
        return ""; // 如果没有找到，返回null
    }

    public Integer getValue() {
        return value;
    }

    public String getTitle() {
        return title;
    }
}
